package com.example.tool.subject;

import com.example.tool.module.ModuleInformation;
import com.example.tool.ui.HToolIcon;
import com.intellij.ide.util.projectWizard.JavaModuleBuilder;
import com.intellij.ide.util.projectWizard.ModuleBuilder;
import com.intellij.ide.util.projectWizard.ModuleWizardStep;
import com.intellij.ide.util.projectWizard.SettingsStep;
import com.intellij.openapi.module.JavaModuleType;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.Icon;

public class HToolModuleType extends JavaModuleType {
  public HToolModuleType() {
    this(ModuleInformation.MODULE_ID);
  }

  protected HToolModuleType(@NonNls String id) {
    super(id);
  }

  @Override
  public @Nullable ModuleWizardStep modifyProjectTypeStep(@NotNull SettingsStep settingsStep, @NotNull ModuleBuilder moduleBuilder) {
    return HToolModuleWizardStep.getInstance();
  }

  @Override
  public @NotNull String getName() {
    return ModuleInformation.MODULE_NAME;
  }

  @NotNull
  @Override
  public String getDescription() {
    return ModuleInformation.MODULE_DESCRIPTION;
  }


  @NotNull
  @Override
  public JavaModuleBuilder createModuleBuilder() {
    return HToolModuleBuilder.getInstance();
  }

  @Override
  @NotNull
  public Icon getNodeIcon(boolean isOpened) {
    return HToolIcon.MODULE_ICON;
  }
}